package com.example.yijian.draft;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.yijian.MainActivity;
import com.example.yijian.R;

import org.jetbrains.annotations.NotNull;

public class DraftAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private int state = MainActivity.MANAGER_CANCEL;

    public void setState(int state) {
        this.state = state;
        notifyDataSetChanged();
    }

    public DraftAdapter() {
        super(R.layout.adapter_draft);
        addChildClickViewIds(R.id.tv_upload, R.id.iv_more);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, String s) {
        holder.setText(R.id.tv_video_name, "hahaha")
                .setGone(R.id.checkbox, state != MainActivity.MANAGER)
                .setGone(R.id.iv_more, state != MainActivity.MANAGER_CANCEL);
    }
}
